home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / util / cdity / ModeProSrc.lha / Daemon / MPCloneWB.c < prev    next >
C/C++ Source or Header  |  1997-06-14  |  1KB  |  43 lines

  1. #include "MP.h"
  2. extern struct Screen * __asm (*OldLockPubScreen)(register __a0 UBYTE *Name,
  3.                                                register __a6 struct Library *);
  4.  
  5. BOOL CloneWB(struct DefaultNode *DNode)
  6. {
  7.   struct Screen *wscr;
  8.   struct DrawInfo *dri;
  9.   ULONG misc;
  10.   BOOL rv;
  11.   
  12.   rv=0;
  13.   if(wscr=OldLockPubScreen("Workbench",(struct Library *)IntuitionBase))
  14.   {
  15.     if(dri=GetScreenDrawInfo(wscr))
  16.     {
  17.       misc=GetVPModeID(&wscr->ViewPort);
  18.       switch(DNode->ModeSelect)
  19.       {
  20.         case MS_PROMOTE_MONITOR:
  21.           DNode->ModeID=(MONITOR_ID_MASK & misc);
  22.           break;
  23.         case MS_PROMOTE_SCREENMODE:
  24.         case MS_PROMOTE_REQUESTER:
  25.           DNode->ModeID=misc;
  26.           DNode->Width=wscr->Width;
  27.           DNode->Height=wscr->Height;
  28.           DNode->Depth=dri->dri_Depth;
  29.           DNode->Flags|=DEPTH;
  30.           break;
  31.       }
  32.       DNode->FontType   =SFONT_SYS;
  33.       DNode->Look3D     =1;
  34.       DNode->Flags      |=(DNF_3D_DEFAULT|SHAREPENS);
  35.       DNode->AutoScroll =1;
  36.       rv=1;
  37.       FreeScreenDrawInfo(wscr,dri);
  38.     }
  39.     UnlockPubScreen(0,wscr);
  40.   }
  41.   return(rv);
  42. }
  43.